<template>
	<div class="person">
		<h1>我是Person组件</h1>
		<h3>我叫：{{name}}</h3>
		<h3>我今年：{{age}}岁了</h3>
		<button @click="showInfo">点我提示个人信息</button>
	</div>
</template>

<script>
	export default {
		name:'Person',
		data() {
			return {
				name:'张三',
				age:18
			}
		},
		methods:{
			showInfo(){
				alert(`我叫：${this.name}，我今年${this.age}岁了`)
			}
		}
	}
</script>

<style>
	.person{
		background-color: skyblue;
		padding: 20px;
	}
</style>